#!/bin/bash -e

######################################################
# file : postinst
#   Script invoked by dpkg installer after laying down the files
#
# Author : Anil Kainikara (anilkumar911@gmail.com)
#
# This code is licenced under the GPL.
#
######################################################

#dirty P)

#if [[ ! -a /usr/bin/editdiary ]]
#then
#  ln -s  /opt/powerdiary2/bin/editdiary /usr/bin/editdiary
#fi
#
#if [[ ! -a /usr/bin/p2search ]]
#then
#  ln -s  /opt/powerdiary2/bin/p2search.pl /usr/bin/p2search
#fi
#
#if [[ ! -a /usr/bin/todo ]]
#then
#  ln -s  /opt/powerdiary2/bin/todo /usr/bin/todo
#fi
#
#if [[ ! -a /usr/bin/todo ]]
#then
#  ln -s  /opt/powerdiary2/bin/p2expensesum /usr/bin/p2expensesum
#fi

mkdir -p /opt/powerdiary2/conf/

if [[ ! -a /opt/powerdiary2/conf/powerdiary2.properties ]]
then
  ln -s /opt/powerdiary2/lib/powerdiary2.properties /opt/powerdiary2/conf/powerdiary2.properties
fi

#TODO:
# Set classpath.
# add crontab entry. per user ?? 
# set up the script to update the calendar in bin
echo "U are ready to Rock !!"
